import uuid
from typing import Any

import pytest

from recruit.domain.models.resume_about_us import (
    BaseResumeAboutUs,
    ResumeAboutUsCreate,
    ResumeAboutUsResult,
    ResumeAboutUsUpdate,
)
from .utils import check_attr_model, check_json_schema


@pytest.mark.parametrize(
    'data, keys', [(
            {
                'about_us': 'About Us'
            },
            ('aboutUs',)
    )]
)
def test_resume_about_us_base(
        data: dict[str, str],
        keys: tuple[str, ...]
) -> None:
    check_attr_model(BaseResumeAboutUs, data)
    check_json_schema(BaseResumeAboutUs, keys)
    check_attr_model(BaseResumeAboutUs, {}, tuple(data))
    check_json_schema(BaseResumeAboutUs, keys)


@pytest.mark.parametrize(
    'data, keys', [(
            {
                'about_us': 'About Us'
            },
            ('aboutUs',)
    )]
)
def test_resume_about_us_create(
        data: dict[str, str],
        keys: tuple[str, ...]
) -> None:
    check_attr_model(ResumeAboutUsCreate, data)
    check_json_schema(ResumeAboutUsCreate, keys)


@pytest.mark.parametrize(
    'data, keys', [(
            {
                'id': uuid.uuid4(),
                'about_us': 'About Us'
            },
            ('id', 'aboutUs')
    )]
)
def test_resume_about_us_result(
        data: dict[str, Any],
        keys: tuple[str, ...]
) -> None:
    check_attr_model(ResumeAboutUsResult, data)
    check_json_schema(ResumeAboutUsResult, keys)
    check_attr_model(ResumeAboutUsResult, {}, tuple(data))
    check_json_schema(ResumeAboutUsResult, keys)


@pytest.mark.parametrize(
    'data, keys', [(
            {
                'about_us': 'About Us'
            },
            ('aboutUs',)
    )]
)
def test_resume_about_us_update(
        data: dict[str, str],
        keys: tuple[str, ...]
) -> None:
    check_attr_model(ResumeAboutUsUpdate, data)
    check_json_schema(ResumeAboutUsUpdate, keys)
    check_attr_model(ResumeAboutUsUpdate, {}, tuple(data))
    check_json_schema(ResumeAboutUsUpdate, keys)
